<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //不区分大小写的 i 全局查找 g
         let name="Cdtw.com";
              console.log(name.match(/c+/ig));//['C', 'c']

        //多行匹配 m
        let web=`
         <span>
           #1 mysql,250元 #
           #2 css,45元 #
           #3 html,45元 #
           #4 node.js # 唐玮
         </span>
        `;
        console.log(web.match(/^\s+#\d+\s+.+\s+#$/gm));
        //  ['           #1 mysql,250元 #', '           #2 css,45元 #', '           #3 html,45元 #']
        console.log(web.match(/^\s+#\d+\s+.+\s+#$/gm)[0]);// #1 mysql,250元 #
       
        
        //去除#号
      let filter_web=  web.match(/^\s+#\d+\s+.+\s+#$/gm).map(v=>{
           v= v.replace((/^\s+#\d+\s+/),"").replace((/元\s+#$/),"");
           [name,price]=v.split(",");
           return {name,price};
        });
        console.log(filter_web);
       console.log(filter_web[0].name);
    
       
       // s模式是忽略换行符
    </script>
</body>
</html>